
class ArithProgression extends Progression {
	
	protected long inc;
	
	// First and cur variables are inherited from superclass.'
	
	/**
	 *  Default constructor, which calls parametric constructor.
	 *  Illustrates exception in constructor chaining.
	 *  When first statement of constructor calls another constructor in same
	 *  class using 'this', superclass constructor is not called.
	 *  
	 *  However, superclass constructor gets called eventually, because
	 *  parametric constructor has superclass constructor as its first line
	 *  implicitly.
	 *
	 */
	ArithProgression() {
       this(1);
	}
	
	ArithProgression (long increment) {
		inc = increment;
	}
	
	protected long nextValue() {
		cur += inc;
		return cur;
	}
}
